package io.hots.mq;

import io.hots.controller.request.ScanCodeRequest;
import io.hots.util.JsonUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author yueshibin@cetcbigdata.com
 * @date 2022/6/17 8:47 下午
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CodeMessage implements Serializable {

    /**
     * 消息队列id
     */
    private String messageId;

    /**
     * 业务id
     */
    private String bizId;

    /**
     * 用户编号
     */
    private Long userId;

    /**
     * 消息体
     */
    private String content;

    /**
     * 备注
     */
    private String remark;


    public CodeMessage(String id, Long userId, ScanCodeRequest request) {
        this.messageId = id;
        this.userId = userId;
        this.content = JsonUtil.obj2Json(request);
    }
}
